Skip to content

feature(protoc-gen-prost-serde): add "feature" option - #134

Merged
siennathesane merged 3 commits into
neoeinstein:mainfrom
aleasims:feature/feature-option
Jan 19, 2026
Merged

feature(protoc-gen-prost-serde): add "feature" option#134
siennathesane merged 3 commits into
neoeinstein:mainfrom
aleasims:feature/feature-option

Conversation

@aleasims

@aleasims aleasims commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

This PR adds feature(=<string>) option to add to generated include directives. This is helpful if you want to enable Serde support by a Cargo feature of your crate. With this option used all include-s will look like:

#[cfg(feature = "serde")]
include!("my.generated.file.rs");

@aleasims

aleasims commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@siennathesane I'd appreciate your opinion on this 🙏

I implemented this cause I wasn't able to find any reasonable workaround for the use case "I want Serde only when "serde" is enabled".

@siennathesane

Copy link
Copy Markdown
Collaborator

I think I can be okay with this. Can you please add an example, or update an example with this? That way folks can understand how it's used.

@aleasims

Copy link
Copy Markdown
Contributor Author

@siennathesane added the usage example to existing example code. Also fixed a bug in the implementation I've made 🙈

@siennathesane siennathesane left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the contribution! I'll release this soon.

@siennathesane
siennathesane merged commit 621d0b9 into neoeinstein:main Jan 19, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants